package java0507;

import java.util.Scanner;

// 牛客网:INOC产品部, 杨辉三角的变形
public class Main {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int ret = func(n);
            System.out.println(ret);
        }
    }

    public static int func(int n) {
        int[][] box = new int[n][n];
        for (int i = 0; i < n; i++) {
            box[i][n - 1] = 1;
            box[i][n - i - 1] = 1;
        }
        for (int i = 1; i < n; i++) {
            for (int j = n - i; j < n - 1; j++) {
                box[i][j] = (box[i - 1][j - 1] + box[i - 1][j] + box[i - 1][j + 1]) % 2;
            }
        }
        for (int i = 0; i < n; i++) {
            if (box[n - 1][i] == 0) {
                return i + 1;
            }
        }
        return -1;
    }
}
